#include<bits/stdc++.h>
using namespace std;
using ll=long long ;
int main() {
//	cout<<1LL*111111*111111<<endl;

    //freopen("C.in","r",stdin);
    int n;
    cin>>n;
    while(n--){
        int m;cin>>m;
        cout<<m*(m+1)*(m+2)/6<<endl;
    }

    return 0;
}